package com.hxd.mall.network.module

import com.hxd.mall.network.service.IAccountFunctionApi
import com.hxd.mall.network.service.IConfigureFunctionApi
import com.hxd.mall.network.service.IMeFunctionApi
import dagger.Module
import dagger.Provides
import retrofit2.Retrofit
import javax.inject.Named
import javax.inject.Singleton

/**
 * 分模块提供网络接口
 * Created by qishuai on 2018/7/30.
 */
/**
 * 未使用，使用的是ManagerFunctionApi
 */
@Module
class MainServiceModule {

    @Singleton
    @Provides
    fun providerMainService(@Named("default") mainRetrofit: Retrofit): IMeFunctionApi {
        return mainRetrofit.create(IMeFunctionApi::class.java)
    }

    @Singleton
    @Provides
    fun providerAccountFunctionApi(@Named("default") mainRetrofit: Retrofit): IAccountFunctionApi {
        return mainRetrofit.create(IAccountFunctionApi::class.java)
    }

    @Singleton
    @Provides
    fun providerBorrowMoneyFunctionApi(@Named("default") mainRetrofit: Retrofit): IConfigureFunctionApi {
        return mainRetrofit.create(IConfigureFunctionApi::class.java)
    }
}